{include file="public/head"}
<style type="text/css" media="screen">
    .x-body {
        min-width: 1200px;
    }

    body {
        overflow-x: scroll;
    }

    .x-right button {
        display: initial;
    }
</style>
<body>
<div class="x-body">
    <div class="lotus-nav">
        <div class="layui-input-inline">
            <input id="express" name="express" class="layui-input" placeholder="运单号" value="{$Think.get.express}">
        </div>
        <div class="layui-input-inline">
            <input id="waybill" name="waybill" class="layui-input" placeholder="追踪号" value="{$Think.get.waybill}">
        </div>
        <div class="layui-input-inline layui-form">
            <select name="platform" id="platform" lay-verify="platform">
                <option value="">运单平台</option>
                {volist name="platform" id="vo"}
                <option value="{$vo.id}" {if $Think.get.platform eq $vo['id']} selected {/if}>{$vo.name}</option>
                {/volist}
            </select>
        </div>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="start" name="start" value="{$Think.get.start}"
                   placeholder="开始日期">
        </div>

        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="end" name="end" value="{$Think.get.end}" placeholder="结束日期">
        </div>
        <input type="hidden" id="company_id" name="company_id" value="{$Think.get.company_id}">
        <button class="layui-btn layui-btn-sm" onclick="search()">
            <i class="layui-icon layui-icon-search"></i>搜索
        </button>

        <span class="x-right">共有数据:<i class="i_count">{$waybill->total()}</i>条
            <button onclick="javascript:location.reload()" class="layui-btn-default ">
                <i class="layui-icon layui-icon-refresh"></i>
            </button>
        </span>
    </div>


    <table class="layui-table">
        <thead>
        <tr>
            <th style="width: 50px;text-align:center"></th>
            <th style="width:115px;text-align:center">商品图片</th>
            <th>运单号</th>
            <th>追踪号</th>
            <th style="width: 120px;text-align:center">物流</th>
            <th style="width: 80px;text-align:center">运费</th>
            <th style="width: 75px;text-align:center">发货时间</th>
            <th style="width: 60px;text-align:center">审核状态</th>
            <th style="width: 120px;text-align:center">创建时间</th>
            <th style="width: 120px;text-align:center">操作</th>
        </thead>
        <tbody>

        {volist name="list" id="vo"}
        <tr>
            <td style="text-align:center">{$i}</td>
            <td style="text-align: center">
                {if empty($vo['imgpath'])}
                <img src="__images__/noimg.png">
                {else/}
                <img src="{$vo['imgpath']}" onclick="previewImg(this)">
                {/if}
            </td>
            <td>{$vo.express}</td>
            <td>{$vo.waybill}</td>
            <td style="text-align:center">{$vo.logistic}</td>
            <td style="text-align:center">{$vo.fee}{$vo.fee_unit}</td>
            <td style="text-align:center">{$vo.deliver}</td>
            <th style="text-align:center">
                {if $vo['audit'] == 3}
                <b style="color: red">未通过</b>
                {elseif $vo['audit'] == 1}
                <b style="color: blue">未审核</b>
                {else/}
                <b style="color: green">已审核</b>
                {/if}
            </th>
            <td style="text-align:center">{$vo['timestamp']|date="Y-m-d H:i",###}</td>
            <td style="text-align:center">
                {if isession('type') == 1}
                <button class="layui-btn layui-btn-xs"
                        onclick="x_admin_show('编辑','edit.html?id={$vo.id}&company_id={$Think.get.company_id}')">
                    编辑
                </button>
                {else/}
                <button class="layui-btn layui-btn-xs"
                        onclick="x_admin_show('详情','edit.html?id={$vo.id}&company_id={$Think.get.company_id}')">
                    详情
                </button>
                {/if}
                <button class="layui-btn layui-btn-xs  layui-btn-normal"
                        onclick="x_admin_show('订单详情','{:url($vo.url)}?id={$vo.order_id}&company_id={$Think.get.company_id}')">
                    订单详情
                </button>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page">
        <div>
            {$waybill->render()}
        </div>
    </div>
</div>
</body>
{include file="public/foot"}
<script>
    function search() {
        var express = $("#express").val();
        var waybill = $("#waybill").val();
        var start = $("#start").val();
        var end = $("#end").val();
        var company_id = $("#company_id").val();
        var platform = $("#platform").val();
        location.href = "index.html?express=" + express + "&waybill=" + waybill + "&start=" + start + "&end=" + end + "&platform=" + platform + "&company_id=" + company_id;
    }

    layui.use(['laydate', 'form'], function () {
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });
</script>
